package capricornus.components.event
{
	import flash.events.Event;
	import flash.events.EventDispatcher;

	public class SDispatcher
	{
		private static var _dispatcher:EventDispatcher = new EventDispatcher();
		
		public function SDispatcher()
		{
		}
		
		public static function hasEventListener( type:String ):Boolean
		{
			return _dispatcher.hasEventListener( type );
		}
		
		public static function dispatchEvent( event:Event ):void
		{
			_dispatcher.dispatchEvent( event );
		}
		
		/**
		 * 监听消息。注意是弱引用 
		 * @param type
		 * @param listener
		 * @param priority
		 * 
		 */
		public static function addEventListenr( type:String, listener:Function, priority:int=0 ):void
		{
			_dispatcher.addEventListener( type, listener, false, priority, true );
		}
		
		public static function removeEventListener( type:String, listener:Function ):void
		{
			_dispatcher.removeEventListener( type, listener );
		}
	}
}